package com.alex.springbootdemo.exception;

import com.alex.springbootdemo.common.ResultCode;

public class AssertException extends RuntimeException {

    private ResultCode resultCode;

    private String errMsg;

    public AssertException(ResultCode resultCode) {
        super(resultCode.getMessage());
        this.resultCode = resultCode;
        this.errMsg = resultCode.getMessage();
    }

    public AssertException(String errMsg) {
        super(errMsg);
        this.errMsg = errMsg;
    }

    public ResultCode getResultCode() {
        return resultCode;
    }

    public void setResultCode(ResultCode resultCode) {
        this.resultCode = resultCode;
    }

    public String getErrMsg() {
        return errMsg;
    }

    public void setErrMsg(String errMsg) {
        this.errMsg = errMsg;
    }
}
